//package com.example.demo.controller;
//
//import com.example.demo.entity.User;
//import com.example.demo.service.UserService;
////import org.springframework.data.domain.Page;
//import org.springframework.web.bind.annotation.*;
//
//import javax.annotation.Resource;
//import java.util.ArrayList;
//import java.util.List;
//import java.util.Optional;
//
//@RestController
//@RequestMapping("/user")
//public class UserController {
////
////    @Resource
////    private UserService userService;
////
////    @PostMapping("/save")
////    public String save(@RequestBody User user) {
////        long id = System.currentTimeMillis();
////        user.setId(id);
////        userService.save(user);
////        return "新增成功,id为：" + id;
////    }
////
////    @PostMapping("/update")
////    public String update(@RequestBody User user) {
////        userService.save(user);
////        return "修改成功";
////    }
////
////    @GetMapping("/{id}")
////    public User getById(@PathVariable("id") Long id) {
////        return userService.getById(id);
////    }
////
////    @DeleteMapping("/{id}")
////    public String deleteById(@PathVariable("id") Long id) {
////        userService.deleteById(id);
////        return "删除成功";
////    }
////
////    @GetMapping("/all")
////    public List<User> all() {
////        return userService.getAll();
////    }
////
////    @GetMapping("/listByName")
////    public List<User> listByName(String name) {
////        return userService.getListByName(name);
////    }
////
////    @GetMapping("/listByNameAndAge")
////    public List<User> listByNameAndAge(String name, Integer age) {
////        return userService.getListByNameAndAge(name, age);
////    }
////
////    @GetMapping("/listOrderByAgeDesc")
////    public List<User> listOrderByAgeDesc() {
////        return userService.getListOrderByAgeDesc();
////    }
////
//////    @GetMapping("/page")
//////    public Page<User> page(Integer pageNum, Integer pageSize) {
//////        return userService.getPage(pageNum, pageSize);
//////    }
////
////    @PostMapping("test")
////    public List<User> test(){
////        List<User> a = new ArrayList<>();
////        User x = new User();
////        x.setId(Long.decode("123"));
////        //a.add(x);
////        Optional<List<User>> f = Optional.of(a);
//////        if(f.isPresent()){
//////            String s = "2w2";
//////            return f.get();
//////        }
////        f.get().forEach(item->{
////            item.setAge(13);
////        });
////        return f.get();
////    }
//}
